home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 3 #11 / Commodore_Disk_User_Vol.3_11_1990_-.d64 / techno info (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  3KB  |  71 lines

  1. 10 rem ********************************
  2. 20 rem *     techno info program      *
  3. 30 rem *  written for september 1990  *
  4. 40 rem *  issue of cdu by j.r.finch.  *
  5. 50 rem ********************************
  6. 60 :
  7. 70 :
  8. 80 sa=832: rem ** start address for data
  9. 100 print"[147]":input"how many data items to created (1-100)  ";n
  10. 110 if n<1 or n>100 then 100
  11. 120 print"please wait: storing values as if it    were sprite data info..."
  12. 125 print"program will write lines containing 8"
  13. 127 print"bytes and therefore may write more than you intend."
  14. 130 forx=1ton:poke831+x,int(rnd(1)*256):next: rem ** create random data
  15. 140 :
  16. 150 input"enter start line number (1000-60000)    ";sl
  17. 160 if sl<1000 or sl>60000 then print"[145][145][145]":goto150
  18. 170 input"enter line increment (1-100)            ";li
  19. 180 if li<1 or li>100 then print"[145][145][145][145]":goto170
  20. 190 :
  21. 200 rem *******************************
  22. 210 rem * we shall start printing the *
  23. 220 rem * data, exiting and then      *
  24. 230 rem * re-entering the program     *
  25. 240 rem * shortly: save any variables *
  26. 250 rem * now to some locations in    *
  27. 260 rem * memory as shown by the      *
  28. 270 rem * example line 300            *
  29. 280 rem *******************************
  30. 290 :
  31. 300 poke 679,x1:poke 680,y1:poke 681,c1
  32. 310 :
  33. 320 rem *******************************
  34. 330 rem * store start line/ address / *
  35. 340 rem * increment/ no.of data items *
  36. 350 rem *******************************
  37. 360 :
  38. 365 poke 682,((sl/256)-int(sl/256))*256:poke 683,sl/256
  39. 370 poke 685,((sa/256)-int(sa/256))*256:poke 686,sa/256
  40. 375 poke 687,li
  41. 380 poke 688,((n/256)-int(n/256))*256:poke 689,n/256
  42. 385 :
  43. 390 rem *******************************
  44. 400 rem * program will return to line *
  45. 410 rem * 500 so start retrieving     *
  46. 420 rem * variables and calculating   *
  47. 430 rem * next line number and address*
  48. 440 rem * at that line and let loc'n  *
  49. 450 rem * two hold the value for the  *
  50. 460 rem * number of lines done so far *
  51. 470 rem *******************************
  52. 480 :
  53. 490 poke2,0
  54. 500 nl=(peek(682)+peek(683)*256)+peek(687)*peek(2): rem ** calc. next line nmbr
  55. 510 ad=peek(685)+peek(686)*256+peek(2)*8: rem ** start addr. for 1st of next 8
  56. 520 :
  57. 525 if ad>=((peek(688)+peek(689)*256)+(peek(685)+peek(686)*256)) then 620
  58. 530 print"[147]"nl"data";
  59. 540 for x=0 to 7: print peek(ad+x)"[157],";: next: rem ** print out values of next 8
  60. 550 print"[157] ":print"goto500";:rem ** end of last line - get ready to exit
  61. 560 :
  62. 565 poke2,peek(2)+1: rem ** increase no. of lines done (max=255)
  63. 570 poke631,13:poke632,13:poke198,2:end
  64. 580 rem ^^ fill buffer with chr$(13) and exit program
  65. 590 rem ** line will be entered, and computer will execute 'goto' statement
  66. 600 rem ** thus returning to line 500 for more if any is left
  67. 610 :
  68. 620 rem ** all done so exit program (return from a subroutine if necessary)
  69. 630 :
  70. 640 end
  71.